<?php

class TaxCalculatorHelper {

  
    public function  TaxCalculatorHelper() {
        
    }
    public function getLoanTotal($loanAmounts) {

        $loanAmount = 0;
        foreach ($loanAmounts as $amount) {
            $loanAmount += $amount;
        }
        return $loanAmount;
    }

    public function getNumberOfLoans($loanAmounts) {

        // zero indicates false
        $mortgage = 0;
        foreach ($loanAmounts as $amount) {
            if ($amount > 0) {
                $mortgage++;
            }
        }

        return $mortgage;
    }

    public function getPayoffTotal($payoffAmounts) {
        
        $amount = 0;
        foreach ($payoffAmounts as  $payoff) {
            $amount += $payoff->getValue();
        }
        return $amount;
    }
}

?>
